delta: Add missing `goto out` for failure to mmap()
authorColin Walters <walters@verbum.org>
Thu, 8 Sep 2016 14:29:10 +0000 (10:29 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 8 Sep 2016 14:34:04 +0000 (14:34 +0000)
This was hit in practice when generating a delta for a flatpak app on ARM
it looks like.

Closes: #497
Approved by: alexlarsson

src/libostree/ostree-repo-static-delta-compilation.c

index 188f467d49c9236d120f9e025a70e747e3dd6820..15b1df8d26753faf97fe64b3db197ecd86bb5e93 100644 (file)
@@ -483,6 +483,8 @@ get_unpacked_unlinked_content (OstreeRepo       *repo,
     goto out;
   
   { GMappedFile *mfile = g_mapped_file_new_from_fd (fd, FALSE, error);
+    if (!mfile)
+      goto out;
     ret_content = g_mapped_file_get_bytes (mfile);
     g_mapped_file_unref (mfile);
   }